<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: UWBIRMac Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00223.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">UWBIRMac Class Reference<div class="ingroups"><a class="el" href="a00524.html">IEEE 802.15.4A - Classes that implement the IEEE 802.15.4A UWB PHY.</a> &#124; <a class="el" href="a00509.html">macLayer - MAC layer modules</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="UWBIRMac" --><!-- doxytag: inherits="BaseMacLayer" -->
<p>This class provides helper function for MAC modules that use the UWB-IR IEEE 802.15.4A model.  
 <a href="a00223.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00438_source.html">UWBIRMac.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for UWBIRMac:</div>
<div class="dyncontent">
<div class="center"><img src="a01064.png" border="0" usemap="#UWBIRMac_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for UWBIRMac:</div>
<div class="dyncontent">
<div class="center"><img src="a01065.png" border="0" usemap="#UWBIRMac_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a01066.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00223.html#a0fcaae9c3cefb73372b7290ff4d9092d">initialize</a> (int stage)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization of the module and some variables.  <a href="#a0fcaae9c3cefb73372b7290ff4d9092d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adec88d201429455ea912572c935d8d53"></a><!-- doxytag: member="UWBIRMac::finish" ref="adec88d201429455ea912572c935d8d53" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00223.html#adec88d201429455ea912572c935d8d53">finish</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the simulation has finished. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa20303103ae3ad969d2177b93d72a375"></a><!-- doxytag: member="UWBIRMac::prepareData" ref="aa20303103ae3ad969d2177b93d72a375" args="(UWBIRMacPkt *packet, IEEE802154A::config cfg=IEEE802154A::cfg_mandatory_4M)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>prepareData</b> (<a class="el" href="a00224.html">UWBIRMacPkt</a> *packet, <a class="el" href="a00051.html">IEEE802154A::config</a> cfg=IEEE802154A::cfg_mandatory_4M)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00223.html#acac82faa5c2357def7a7c0ac2363b88b">handleLowerMsg</a> (cMessage *msg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9a22aae5b3a786301ed8a80b93fb1c14"></a><!-- doxytag: member="UWBIRMac::validatePacket" ref="a9a22aae5b3a786301ed8a80b93fb1c14" args="(UWBIRMacPkt *mac)" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>validatePacket</b> (<a class="el" href="a00224.html">UWBIRMacPkt</a> *mac)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a850cbe57fcdbf63fddb1495ee946b14a"></a><!-- doxytag: member="UWBIRMac::initCounters" ref="a850cbe57fcdbf63fddb1495ee946b14a" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>initCounters</b> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a03036f082beb5171b39a36a76cda36bf"></a><!-- doxytag: member="UWBIRMac::debug" ref="a03036f082beb5171b39a36a76cda36bf" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00223.html#a03036f082beb5171b39a36a76cda36bf">debug</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Debug switch for all other modules. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1135b192570e3433d5c09fa638bc1d36"></a><!-- doxytag: member="UWBIRMac::stats" ref="a1135b192570e3433d5c09fa638bc1d36" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>stats</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6885208134f243646d6855eedcff2934"></a><!-- doxytag: member="UWBIRMac::trace" ref="a6885208134f243646d6855eedcff2934" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>trace</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a284abf38f95685722e6e45ce46ebb344"></a><!-- doxytag: member="UWBIRMac::rsDecoder" ref="a284abf38f95685722e6e45ce46ebb344" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>rsDecoder</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a569330d3c1cd0134dd3c74aebe70bf82"></a><!-- doxytag: member="UWBIRMac::packetsAlwaysValid" ref="a569330d3c1cd0134dd3c74aebe70bf82" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>packetsAlwaysValid</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1a2c6f70476af0f1653092c98f7ce9ca"></a><!-- doxytag: member="UWBIRMac::totalRxBits" ref="a1a2c6f70476af0f1653092c98f7ce9ca" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>totalRxBits</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5ae05555cd6ce5aeae19e7f84c0bdac2"></a><!-- doxytag: member="UWBIRMac::errRxBits" ref="a5ae05555cd6ce5aeae19e7f84c0bdac2" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>errRxBits</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a11441696168ae8b05f3d5bb899478656"></a><!-- doxytag: member="UWBIRMac::phy" ref="a11441696168ae8b05f3d5bb899478656" args="" -->
<a class="el" href="a00134.html">MacToPhyInterface</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00223.html#a11441696168ae8b05f3d5bb899478656">phy</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler to the physical layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a537904829cefe54e83b84659f89299d1"></a><!-- doxytag: member="UWBIRMac::packet" ref="a537904829cefe54e83b84659f89299d1" args="" -->
<a class="el" href="a00168.html">Packet</a>&#160;</td><td class="memItemRight" valign="bottom"><b>packet</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab34556877e39f423d17620e9074e5c4b"></a><!-- doxytag: member="UWBIRMac::prf" ref="ab34556877e39f423d17620e9074e5c4b" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>prf</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3266b1085577bafe847ebaa028f40ef5"></a><!-- doxytag: member="UWBIRMac::packetsBER" ref="a3266b1085577bafe847ebaa028f40ef5" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>packetsBER</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a26015e8af493eac0d1b5bba24224ac"></a><!-- doxytag: member="UWBIRMac::dataLengths" ref="a4a26015e8af493eac0d1b5bba24224ac" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>dataLengths</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a651f418a1531432a4b3f6a1d6f3aa127"></a><!-- doxytag: member="UWBIRMac::erroneousSymbols" ref="a651f418a1531432a4b3f6a1d6f3aa127" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>erroneousSymbols</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae26f54e275f9baf993bc8c522011d52f"></a><!-- doxytag: member="UWBIRMac::sentPulses" ref="ae26f54e275f9baf993bc8c522011d52f" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>sentPulses</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a92d2428a8c467d27436aa30c2489a4c7"></a><!-- doxytag: member="UWBIRMac::receivedPulses" ref="a92d2428a8c467d27436aa30c2489a4c7" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>receivedPulses</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e37eaa9329e57d22a8880a0a8082e29"></a><!-- doxytag: member="UWBIRMac::meanPacketBER" ref="a7e37eaa9329e57d22a8880a0a8082e29" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>meanPacketBER</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acb9c37a88347a1bd11ab5a75413721f0"></a><!-- doxytag: member="UWBIRMac::packetSuccessRate" ref="acb9c37a88347a1bd11ab5a75413721f0" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>packetSuccessRate</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac1697311450e13159c3ec7203c1ca4b6"></a><!-- doxytag: member="UWBIRMac::packetSuccessRateNoRS" ref="ac1697311450e13159c3ec7203c1ca4b6" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>packetSuccessRateNoRS</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a68d05d4253574afaf60260f32eb92ebd"></a><!-- doxytag: member="UWBIRMac::ber" ref="a68d05d4253574afaf60260f32eb92ebd" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>ber</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4b3f2fe8ff1ce4e5e66cd01c3d3d02a"></a><!-- doxytag: member="UWBIRMac::meanBER" ref="ad4b3f2fe8ff1ce4e5e66cd01c3d3d02a" args="" -->
cStdDev&#160;</td><td class="memItemRight" valign="bottom"><b>meanBER</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab3d14ddcaad12ce9bd5b3fd1d714b3fd"></a><!-- doxytag: member="UWBIRMac::RSErrorRate" ref="ab3d14ddcaad12ce9bd5b3fd1d714b3fd" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>RSErrorRate</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9eafa390c144e74c95619e03ada46a4f"></a><!-- doxytag: member="UWBIRMac::success" ref="a9eafa390c144e74c95619e03ada46a4f" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>success</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afc2fc9ae65ec06363b3d7a29ff0794e1"></a><!-- doxytag: member="UWBIRMac::successNoRS" ref="afc2fc9ae65ec06363b3d7a29ff0794e1" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>successNoRS</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a57a803da655d86bf651b9b6cd6e1af38"></a><!-- doxytag: member="UWBIRMac::nbReceivedPacketsNoRS" ref="a57a803da655d86bf651b9b6cd6e1af38" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbReceivedPacketsNoRS</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa253392777c64f7b63b4042058ec7099"></a><!-- doxytag: member="UWBIRMac::nbReceivedPacketsRS" ref="aa253392777c64f7b63b4042058ec7099" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbReceivedPacketsRS</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae3257757a23e072a3f20cbabcda76c21"></a><!-- doxytag: member="UWBIRMac::nbSentPackets" ref="ae3257757a23e072a3f20cbabcda76c21" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbSentPackets</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a59e141df0fd79f64afe9bd674071a413"></a><!-- doxytag: member="UWBIRMac::nbSymbolErrors" ref="a59e141df0fd79f64afe9bd674071a413" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbSymbolErrors</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3f655e1fb1ef295f36f08f1e31ece2c4"></a><!-- doxytag: member="UWBIRMac::nbSymbolsReceived" ref="a3f655e1fb1ef295f36f08f1e31ece2c4" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbSymbolsReceived</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a84f5a65393a219062a370575bcfb4261"></a><!-- doxytag: member="UWBIRMac::nbHandledRxPackets" ref="a84f5a65393a219062a370575bcfb4261" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbHandledRxPackets</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aadeda031c42b657e1cc6bec50d6fea14"></a><!-- doxytag: member="UWBIRMac::nbFramesDropped" ref="aadeda031c42b657e1cc6bec50d6fea14" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbFramesDropped</b></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a47b8ea01a0e0b5c57294a66f2e1120f0"></a><!-- doxytag: member="UWBIRMac::UWBIRMac" ref="a47b8ea01a0e0b5c57294a66f2e1120f0" args="(const UWBIRMac &amp;)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00223.html#a47b8ea01a0e0b5c57294a66f2e1120f0">UWBIRMac</a> (const <a class="el" href="a00223.html">UWBIRMac</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor is not allowed. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0b7a0b9f480c6be20338a451eeb63530"></a><!-- doxytag: member="UWBIRMac::operator=" ref="a0b7a0b9f480c6be20338a451eeb63530" args="(const UWBIRMac &amp;)" -->
<a class="el" href="a00223.html">UWBIRMac</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00223.html#a0b7a0b9f480c6be20338a451eeb63530">operator=</a> (const <a class="el" href="a00223.html">UWBIRMac</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator is not allowed. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This class provides helper function for MAC modules that use the UWB-IR IEEE 802.15.4A model. </p>
<p>Just before sending down a packet to the UWBIRPhyLayer, call prepareData(UWBIRMacPkt* packet). Just after receiving a packet from the UWBIRPhyLayer, call validatePacket(UWBIRMacPkt* packet) and check the returned bool value to know if the packet could be decoded successfully. </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="acac82faa5c2357def7a7c0ac2363b88b"></a><!-- doxytag: member="UWBIRMac::handleLowerMsg" ref="acac82faa5c2357def7a7c0ac2363b88b" args="(cMessage *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void UWBIRMac::handleLowerMsg </td>
          <td>(</td>
          <td class="paramtype">cMessage *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>If message arrives from lower layer, check whether it is for us. Send it up if yes.</p>
<p>This basic implementation just forwards all message that are broadcast (destAddr = L2BROADCAST) or destined for this node (destAddr = nic module getId()) to the network layer</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="a00025.html#adbf061566606041db811b519f0400ed5" title="Sends a message to the upper layer.">sendUp</a> </dd></dl>

<p>Reimplemented from <a class="el" href="a00026.html#a413375cec02b990a521b62086a02264c">BaseMacLayer</a>.</p>

<p>Reimplemented in <a class="el" href="a00008.html#a585dd6a0b5c3c6a33e1f760ccd8ac29e">AlohaMacLayer</a>.</p>
<div class="fragment"><pre class="fragment">                                           {
  <a class="code" href="a00224.html">UWBIRMacPkt</a> *mac = <span class="keyword">static_cast&lt;</span><a class="code" href="a00224.html">UWBIRMacPkt</a> *<span class="keyword">&gt;</span> (msg);

  <span class="keywordflow">if</span> (validatePacket(mac)) {
    <span class="keyword">const</span> <a class="code" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210" title="Type definition for a L2 (MAC) address.">LAddress::L2Type</a>&amp; dest = mac-&gt;getDestAddr();
    <span class="keyword">const</span> <a class="code" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210" title="Type definition for a L2 (MAC) address.">LAddress::L2Type</a>&amp; src  = mac-&gt;getSrcAddr();
    <span class="keywordflow">if</span> ((dest == <a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a>)) {
      debugEV&lt;&lt; <span class="stringliteral">&quot;message with mac addr &quot;</span> &lt;&lt; src
      &lt;&lt; <span class="stringliteral">&quot; for me (dest=&quot;</span> &lt;&lt; dest
      &lt;&lt; <span class="stringliteral">&quot;) -&gt; forward packet to upper layer&quot;</span> &lt;&lt; std::endl;
      <a class="code" href="a00025.html#adbf061566606041db811b519f0400ed5" title="Sends a message to the upper layer.">sendUp</a>(<a class="code" href="a00026.html#a998b4c4c56074a354b50f8c4fc5d6d4c" title="decapsulate the network message from the MacPkt">decapsMsg</a>(mac));
    } <span class="keywordflow">else</span> {
      debugEV &lt;&lt; <span class="stringliteral">&quot;message with mac addr &quot;</span> &lt;&lt; src
      &lt;&lt; <span class="stringliteral">&quot; not for me (dest=&quot;</span> &lt;&lt; dest
      &lt;&lt; <span class="stringliteral">&quot;) -&gt; delete (my MAC=&quot;</span> &lt;&lt; <a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a> &lt;&lt; <span class="stringliteral">&quot;)&quot;</span> &lt;&lt; std::endl;
      <span class="keyword">delete</span> mac;
    }
  } <span class="keywordflow">else</span> {
    debugEV &lt;&lt; <span class="stringliteral">&quot;Errors in message ; dropping mac packet.&quot;</span> &lt;&lt; std::endl;
    <span class="keyword">delete</span> mac;
  }
}
</pre></div>
</div>
</div>
<a class="anchor" id="a0fcaae9c3cefb73372b7290ff4d9092d"></a><!-- doxytag: member="UWBIRMac::initialize" ref="a0fcaae9c3cefb73372b7290ff4d9092d" args="(int stage)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void UWBIRMac::initialize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stage</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialization of the module and some variables. </p>
<p>First we have to initialize the module from which we derived ours, in this case <a class="el" href="a00025.html" title="A very simple layer template.">BaseLayer</a>. </p>

<p>Reimplemented from <a class="el" href="a00026.html#a61c82dc3b225eac37f7fa9936c28c2c3">BaseMacLayer</a>.</p>

<p>Reimplemented in <a class="el" href="a00008.html#abab6939a0c82122391528d386df97c2c">AlohaMacLayer</a>.</p>

<p>References <a class="el" href="a00025.html#ad8ba02d92dd106da1d85192eb28250c0">BaseLayer::catDroppedPacketSignal</a>, <a class="el" href="a00201.html#aa01f017b96087bc252445206777e0080">simsignalwrap_t::initialize()</a>, and <a class="el" href="a00026.html#a61c82dc3b225eac37f7fa9936c28c2c3">BaseMacLayer::initialize()</a>.</p>

<p>Referenced by <a class="el" href="a00008.html#abab6939a0c82122391528d386df97c2c">AlohaMacLayer::initialize()</a>.</p>
<div class="fragment"><pre class="fragment">                                   {
  <a class="code" href="a00223.html#a0fcaae9c3cefb73372b7290ff4d9092d" title="Initialization of the module and some variables.">BaseMacLayer::initialize</a>(stage);
  <span class="keywordflow">if</span> (stage == 0) {
    <a class="code" href="a00025.html#ad8ba02d92dd106da1d85192eb28250c0" title="Signal for dropped packets.">BaseLayer::catDroppedPacketSignal</a>.<a class="code" href="a00201.html#aa01f017b96087bc252445206777e0080">initialize</a>();

    <a class="code" href="a00223.html#a03036f082beb5171b39a36a76cda36bf" title="Debug switch for all other modules.">debug</a> = par(<span class="stringliteral">&quot;debug&quot;</span>).boolValue();
    stats = par(<span class="stringliteral">&quot;stats&quot;</span>).boolValue();
    trace = par(<span class="stringliteral">&quot;trace&quot;</span>).boolValue();
    prf   = par(<span class="stringliteral">&quot;PRF&quot;</span>);
    assert(prf == 4 || prf == 16);
    packetsAlwaysValid = par(<span class="stringliteral">&quot;packetsAlwaysValid&quot;</span>);
    rsDecoder          = par(<span class="stringliteral">&quot;RSDecoder&quot;</span>).boolValue();
    <a class="code" href="a00223.html#a11441696168ae8b05f3d5bb899478656" title="Handler to the physical layer.">phy</a> = <a class="code" href="a00093.html" title="Provides method templates to find omnet modules.">FindModule&lt;MacToPhyInterface*&gt;::findSubModule</a>( this-&gt;<a class="code" href="a00026.html#ae51d8e3e0977cfc1d4f10f8135378fc4" title="Pointer to nic Module.">getNic</a>() );
    initCounters();
  }
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/mac/<a class="el" href="a00438_source.html">UWBIRMac.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/mac/UWBIRMac.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00223.html">UWBIRMac</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:33 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
